{if count($results) == 0}

<p class="i">No Results Found</p>

{else}

<table width="95%">
	<thead>
		<tr>
			<th align="left" width = "40%">Title</th>
			<th align="left" width = "20%">Author</th>
			<th align="right" width = "20%">Last Updated</th>
			<th align="right" width = "20%">Approve-Edit-Delete</th>
		</tr>
	</thead>
	<tbody>
		{foreach from=$results item=row name=res}
		<tr class="{if $smarty.foreach.res.index % 2 == 0}searchodd{else}searcheven{/if}">
			<td align="left">
				{if $row.Approved == "N" || $row.Approved == "Y"}
				<a href="v.php?a={$row.FileID}">{$row.Title}</a>
				{elseif $row.Approved == "Q"}
				<a href="saa.php?a={$row.FileID}">{$row.Title}</a>
				{elseif $row.Approved == "A"}
				<a href="v.php?a={$row.ParentID}">{$row.Title} (Answered)</a>
				{/if}
			</td>
			<td align="left">
				{if $row.AuthorID != 0}
				<a href="a_authord.php?aid={$row.AuthorID}">{$row.FirstName} {$row.LastName}</a>
				{else}
					Guest
				{/if}
			</td>
			<td align="right">{$row.SubmitDate}</td>
			<td align="right">
				{if $row.Approved == "N"}
				<a href="pending.php?acq={$pgtype}&approveid={$row.FileID}">Approve</a>&nbsp;&nbsp;
				{elseif $row.Approved == "Q"}
				<a href="saa.php?a={$row.FileID}">Answer</a>&nbsp;&nbsp;
				{/if}
				<a href="saa.php?fileid={$row.FileID}">Edit</a>&nbsp;&nbsp;
				{if $row.Approved != "A"}
				<a href="pending.php?acq={$pgtype}&delid={$row.FileID}">Delete</a>
				{/if}
			</td>
		</tr>
		{/foreach}
	</tbody>
</table>

{/if}